package com.oazon.sonos.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.util.Log;

public class XmlProcess {
	private final static String TAG = "XmlProcess";
	public static String processXml(String xml) {
		Log.d(TAG, "-------------before process--------------");
		Log.d(TAG, "xml: " + xml);
		String result = xml;
		String regex = "<[A-Za-z]*[1-9]*:";
		Pattern pattern = Pattern.compile(regex);

		Matcher matcher = pattern.matcher(xml);

		result = matcher.replaceAll("<");
		
		regex = "</[A-Za-z]*[1-9]*:";
		pattern = Pattern.compile(regex);
		matcher = pattern.matcher(result);
		
		result = matcher.replaceAll("</");
		
		Log.d(TAG, "-------------after process---------------");
		Log.d(TAG, "xml: " + result);

		return result;
		
	}

}
